Skip to main content

All Questions

3votes
2answers
150views

Simple recursive transformation solution in Python

This simple Python code I wrote for a problem asked during an interview. The problem statement is: Given a tuple (a, b), transform this into (c, d) by applying any of the two below operations ...
Vikrant Biswas's user avatar
7votes
1answer
44kviews

Count duplicates in a JavaScript array

This is actually a hackerrank interview question I have already solved but I need guidance on how to optimize it for the Time Space Given an array of integers, your task is to count the number of ...
Mr.X's user avatar
  • 215
4votes
5answers
3kviews

Find The Duplicates in two arrays

Find The Duplicates Given two sorted arrays arr1 and arr2 of passport numbers, implement a function findDuplicates that returns an array of all passport numbers that are both in arr1 and arr2. Note ...
Anirudh Thatipelli's user avatar
3votes
4answers
566views

Finding anagrams in Java (space-optimised)

I've lately been asked in a job interview to program a solution for the well known anagrams problem: given two strings s1 and s2,...
u6f6o's user avatar
4votes
1answer
368views

Construct binary tree from inorder and postorder traversal

The problem is taken from here. The tree is guaranteed not to have duplicate elements. My questions is, instead of creating new arrays leftInOrder, ...
Dabba raaju's user avatar

close